package com.itheima.controller;

import com.itheima.pojo.vo.JobVo;
import com.itheima.pojo.vo.Result;
import com.itheima.pojo.vo.StuCountVo;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    //员工职位统计
    @GetMapping("/empJobData")
    public Result getEmpJobData() {
        JobVo jobVo = reportService.empJobReport();
        return Result.success(jobVo);
    }

    //员工性别统计
    @GetMapping("/empGenderData")
    public Result getEmpGenderData() {
        List<Map<String,Object>> genderList = reportService.empGenderReport();
        return Result.success(genderList);
    }
    //学员学历统计
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData() {
        List<Map<String,Object>> studentDegreeList = reportService.studentDegreeReport();
        return Result.success(studentDegreeList);
    }
    //班级人数统计
    @GetMapping("/studentCountData")
    public Result getStudentCountData() {
        StuCountVo stuCountVo = reportService.studentCountReport();
        return Result.success(stuCountVo);
    }

}
